layui.use(['jquery','form', 'ax','admin','layedit', 'laydate'], function(){
    var $ =layui.jquery
    var form = layui.form
    var layer = layui.layer
    var layedit = layui.layedit
    var laydate = layui.laydate
    var $ax = layui.ax;
    var admin = layui.admin;



    // 表单提交事件
    form.on('submit(btnSubmit)', function (data) {

        alert(JSON.stringify(data));
        $.post({
            url:"/myScheduleFrame/copySframe",
            data:data.field,
            success:function (data) {
                console.log(data);
                if (data.valueOf()=='复制成功！') {
                    Feng.success(data.valueOf()+"正跳转到日程框架页面");
                    //关闭当前窗口
                    admin.closeThisDialog();
                    parent.location.href="/myScheduleFrame/showMyScheduleFrame";

                }else {
                    Feng.error(data.valueOf());
                }
            }
        });
        //添加 return false 可成功跳转页面
        return false;
    });
/*    // 表单提交事件
    form.on('submit(btnSubmit)', function (data) {


        alert(JSON.stringify(data));
        console.log(data)
        var ajax = new $ax(Feng.ctxPath + "/myScheduleFormItem/saveSfromItem", function (data) {
            Feng.success("日程创建成功！");
            //传给上个页面，刷新table用
            admin.putTempData('formOk', true);
            //关掉对话框
            admin.closeThisDialog();
            parent.location.href="/myScheduleForm/showScheduleForm";

        }, function (data) {
            Feng.error( data.responseJSON.message)
        });
        ajax.set(data.field);
        ajax.start();

        //添加 return false 可成功跳转页面
        return false;
    });*/



});
